package com.atstudy.dao;

import com.atstudy.entites.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/2/10 16:13
 * @copyright: 博为峰
 */
@Repository("accountDao")
public class AccountDaoImpl implements AccountDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Account> selectAccountList() {
        return new ArrayList<Account>();
    }

    @Override
    public int updateAccount(String name, int balance) {
        return jdbcTemplate.update("update account set balance = balance + ? where name = ?", balance, name);
    }
}
